﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Linq.Expressions;
using System.Collections.ObjectModel;
using System.Xml.Serialization;

namespace NMoq.Core
{
    public class MockUtil
    {
        public static object[] GetArgs(ReadOnlyCollection<Expression> collection)
        {
            ArrayList args = new ArrayList();
            foreach (Expression exp in collection)
            {
                ConstantExpression constant = exp as ConstantExpression;
                if (constant != null)
                    args.Add(constant.Value);
            }
            return args.ToArray();
        }
    }

    //public class MockConstant
    //{
    //    public static readonly EqualityCompare<MethodMessageInfo> MethodMessageInfoCompare = new EqualityCompare<MethodMessageInfo>();
    //    public static readonly IDataProvider DefaultDataProvider = new DefaultDataProvider();
    //    public static readonly IInterceptor DefaultInterceptor = new DefaultInterceptor();
    //    public static readonly IVerifier DefaultVerifier = new DefaultVerifier();

    //    public static object GetConstant<T>()
    //    {
    //        if (typeof(T) == typeof(IDataProvider))
    //            return DefaultDataProvider;
    //        if (typeof(T) == typeof(IInterceptor))
    //            return DefaultInterceptor;
    //        if (typeof(T) == typeof(IVerifier))
    //            return DefaultVerifier;
    //        return null;
    //    }
    //}
}
